Optimal. Leaf size=24 \[ \frac {1}{3} a \sin ^3(x)+\frac {1}{3} b \cos ^3(x)-b \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3089, 2564, 30, 2633} \[ \frac {1}{3} a \sin ^3(x)+\frac {1}{3} b \cos ^3(x)-b \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2564
Rule 2633
Rule 3089
Rubi steps
\begin {align*} \int \sin ^2(x) (a \cos (x)+b \sin (x)) \, dx &=\int \left (a \cos (x) \sin ^2(x)+b \sin ^3(x)\right ) \, dx\\ &=a \int \cos (x) \sin ^2(x) \, dx+b \int \sin ^3(x) \, dx\\ &=a \operatorname {Subst}\left (\int x^2 \, dx,x,\sin (x)\right )-b \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (x)\right )\\ &=-b \cos (x)+\frac {1}{3} b \cos ^3(x)+\frac {1}{3} a \sin ^3(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.00, size = 26, normalized size = 1.08 \[ \frac {1}{3} a \sin ^3(x)-\frac {3}{4} b \cos (x)+\frac {1}{12} b \cos (3 x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 27, normalized size = 1.12 \[ \frac {1}{3} \, b \cos \relax (x)^{3} - b \cos \relax (x) - \frac {1}{3} \, {\left (a \cos \relax (x)^{2} - a\right )} \sin \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.96, size = 25, normalized size = 1.04 \[ \frac {1}{12} \, b \cos \left (3 \, x\right ) - \frac {3}{4} \, b \cos \relax (x) - \frac {1}{12} \, a \sin \left (3 \, x\right ) + \frac {1}{4} \, a \sin \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.82, size = 20, normalized size = 0.83 \[ -\frac {b \left (2+\sin ^{2}\relax (x )\right ) \cos \relax (x )}{3}+\frac {a \left (\sin ^{3}\relax (x )\right )}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 20, normalized size = 0.83 \[ \frac {1}{3} \, a \sin \relax (x)^{3} + \frac {1}{3} \, {\left (\cos \relax (x)^{3} - 3 \, \cos \relax (x)\right )} b \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.45, size = 32, normalized size = 1.33 \[ -\frac {4\,\left (-2\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+3\,b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+b\right )}{3\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.28, size = 27, normalized size = 1.12 \[ \frac {a \sin ^{3}{\relax (x )}}{3} - b \sin ^{2}{\relax (x )} \cos {\relax (x )} - \frac {2 b \cos ^{3}{\relax (x )}}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________